<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <button @click="add">增加</button><br/>
        <button @click="decrement">减少</button><br/>
        <h1>num: {{num}}</h1>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script type="text/javascript">
        var vm = new Vue({
                el:"#app",
                data:{
                    num:1
                },
            methods:{
                    add(){
                        this.num++;
                    },
                decrement(){
                    this.num--;
                }
            }

            })
    </script>
</body>
</html>